<h1><%= t(:absences_of, {:user => @doctor.name})  %></h1>

<div class="dictionaryDiv">

<span id="newRecordLink">
<%= link_to t(:new_absence) + image_tag(ApplicationHelper::ADD_IMG), new_user_absence_path(@doctor) %>
</span>

<%= collection_table(@absences, :id => 'absences', :class => 'dictionaryTable') do |t|
      t.rows.empty_caption = I18n.t(:no_matches_found)
      t.header :doctor, t(:doctor)
      t.header :since, t(:since)
      t.header :until, t(:until)
      t.header :couse, t(:couse)
      t.header :action, t(:action), :class => 'actionClass'
      t.rows.alternate = :odd
      t.rows.each do |row, absence, index|
        row.doctor    absence.doctor.name
        row.since     absence.since.strftime(ApplicationHelper::DATETIME_FORMAT) if absence.since
        row.until     absence.until.strftime(ApplicationHelper::TIME_FORMAT)  if absence.until 
        row.couse     absence.couse
        row.action   link_to(image_tag(ApplicationHelper::EDIT_IMG),
      edit_absence_path(absence)) +
      link_to(image_tag(ApplicationHelper::DELETE_IMG), absence,
      :method=> :delete, :confirm => t(:are_you_sure_) ) 

      end     
    end
%>

</div>
